package br.edu.udc.JMonster.business.BusinessObject;

import java.util.Date;

import br.edu.udc.JMonster.business.DataTransferObject.AbstractPersistentObject;

/**
 * 2008 - ApolloTi Desenvolvimento de Software LTDA. 
 * Todos os direitos reservados.
 * 
 * @author Rodrigo P. Fraga
 * @email rodrigo@apollo-ti.com
 * @since 10/03/2008
 * @version 1.0
 * @category BusinessObject
 */
public class AbstractBusinessObject <DataTransferObject extends AbstractPersistentObject>
{
	/*-------------------------------------------------------------------
	 *				 		     BEHAVIORS
	 *-------------------------------------------------------------------*/
	public DataTransferObject save(DataTransferObject dto)
	{
		if (dto.getId() == null || dto.getId() == 0)
		{
			dto.setId(null);
			dto.setDtCadastro(new Date());
		}
		else
			dto.setDtAlteracao(new Date());
	
		return dto;
	}
}
